package com.care.service;

import java.util.List;

import javax.annotation.Resource;

import javax.transaction.Transactional;

import org.springframework.stereotype.Service;

import com.care.dao.doctor.DoctorDaoImpl;
import com.care.entity.Admin;
import com.care.entity.Doctor;
import com.care.entity.User;
/**
 * 
 * @author jiangxiongjie
 *	2020年3月9日 下午5:21:19
 */

@Service
@Transactional
public class DoctorServiceImpl {
	@Resource
	private DoctorDaoImpl impl;
	/**
	 * 医生注册功能
	 */
	public void DoctorRegister(Doctor doctor){
		impl.DoctorRegister(doctor);
	}
	/**
	 * 是否已经被注册
	 */	
	public boolean RegisterUnique(String email){
		return impl.RegisterUnique(email);		
	}
	/**
	 * 医生登录
	 * @param doctor
	 * @return
	 */
	public boolean DoctorLogin(Doctor doctor){
		return impl.DoctorLogin(doctor);
	}
	/**
	 * 根据邮箱查询医生全部信息
	 * @param email
	 * @return
	 */	
	public Doctor FindDoctorByEmail(String email){
	  return impl.FindDoctorByEmail(email);		
	}
	/**
	 * 管理员登录
	 * @param admin
	 * @return
	 */
	public boolean AdminLogin(Admin admin){
		return impl.AdminLogin(admin);
	}
	/**
	 * 根据邮箱查询管理员全部信息
	 * @param email
	 * @return
	 */
	public Admin FindAdminByEmail(String email){
		return impl.FindAdminByEmail(email);
	}
	/**
	 * 用户登录
	 * @param user
	 * @return
	 */
	public boolean UserLogin(User user){
		return impl.UserLogin(user);		
	}
	/**
	 * 根据邮箱查询用户全部信息
	 * @param email
	 * @return
	 */
	public User FindUserByEmail(String email){
		return impl.FindUserByUser(email);
	}
	/**
	 * 分页 当前页 与 每页多少条数据
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	public List<Doctor> FindDoctorByPage(int pageNum, int pageSize){
		return impl.FindDoctorByPage(pageNum, pageSize);		
	}
	/***
	 * 总数据
	 * @return
	 */
	public int CountDoctor(){
		return impl.CountDoctor();		
	}
	/**
	 * 科室分页
	 * @param pageNum
	 * @param pageSize
	 * @param section
	 * @return
	 */
	public List<Doctor> FindDoctorBySection(int pageNum,int pageSize,String section){
		return impl.FindDoctorBySection(pageNum, pageSize, section);
	}
	/**
	 * 根据科室计算总数
	 * @param section
	 * @return
	 */
	public int CountSectionDoctor(String section){
		return impl.CountSectionDoctor(section);
		
	}
	public Doctor findDoctor(String email){
		return impl.findDoctor(email);
	}
	/**
	 * 修改医生个人信息
	 * @param doctor
	 * @return 
	 */
	public void updateDoctor(Doctor doctor,String name,String img,String information,String section,String sex,String password){
		impl.updateDoctor(doctor, img, information, name, sex, section, password);
	}
	public void updateMoney(String email,double money){
		impl.updateMoney(email, money);
	}
}
